package orz.itrip.search.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import orz.itrip.dto.Dto;
import orz.itrip.search.service.SearchHotel;
import orz.itrip.search.vo.CityVo;
import orz.itrip.search.vo.HotelVo;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/")
@Api(tags = "酒店搜索",description = "文档说明",hidden = true)
public class SearchController {

    @Resource
    private SearchHotel searchHotel;
    @PostMapping("hotellist/searchItripHotelPage")
    @ApiOperation(value = "查询所有酒店")
    public Dto searchItripHotelPage(@RequestBody HotelVo hotelVo){
        return searchHotel.searchItripHotelPage(hotelVo);
    }
    @PostMapping("hotellist/searchItripHotelListByHotCity")
    @ApiOperation(value = "查询热点酒店")
    public Dto searchItripHotelListByHotCity(@RequestBody CityVo cityVo){
        return searchHotel.searchItripHotelListByHotCity(cityVo.getCityId(),cityVo.getCount());
    }
}
